<!--
  模块：一键求助 - 录入结果 - 录入
-->
<template>
  <div class="help-input-add">

    <!-- 一键求助 - 录入结果 - 录入 -->
      <!-- 头部 -->
      <div class="header">
          <el-button type="primary" @click="PutIn">提交</el-button>
      </div>


        <!-- 内容 -->
      <div class="content">
        <el-row :gutter="20">
          <el-form label-position="top" :model="formParams">
            <el-col :span="12" class="contents">
              <div class="left">

                  <CardFormTitle title="企业信息"></CardFormTitle>

                  <CardFormContent>

                    <el-form-item  label="企业名称">
                        <el-input
                            v-model="formParams.companyName"
                            clearable
                            disabled
                          />
                    </el-form-item>

                    <el-col :span="12">
                      <el-form-item  label="社会信用代码">
                          <el-input
                              v-model="formParams.creditCode"
                              clearable
                              disabled
                          />
                      </el-form-item>
                    </el-col>

                    <el-col :span="12">
                      <el-form-item  label="企业分类">
                          <el-input
                              v-model="formParams.companyType.desc"
                              clearable
                              disabled
                          />
                      </el-form-item>
                    </el-col>
                  </CardFormContent>

                  <div>
                  <CardFormTitle title="问题述求"></CardFormTitle>
                  </div>

                  <CardFormContent>



                  <el-col :span="12">
                    <el-form-item  label="求助类型">
                        <el-input
                            v-model="formParams.helpType.desc"
                            clearable
                            disabled
                          />
                    </el-form-item>
                  </el-col>

                  <el-col :span="12">
                    <el-form-item  label="求助时间">
                        <el-input
                            v-model="formParams.helpTime"
                            clearable
                            disabled
                          />
                    </el-form-item>
                  </el-col>

                  <el-col :span="24">
                    <el-form-item  label="问题和述求描述">
                        <el-input
                            v-model="formParams.queDes"
                            clearable
                            type="textarea"
                            maxlength="1000"
                            show-word-limit
                            disabled
                          />
                    </el-form-item>
                  </el-col>
                  </CardFormContent>


              </div>
            </el-col>
            <el-col :span="12" class="contents" >
              <div class="right" style="text-align:left">
                <CardFormTitle title="分配部门"></CardFormTitle>
                    <div class="right-content">
                          <CardFormContent>
                              <el-col :span="12">
                                    <el-form-item  label="选择部门">
                                        <el-select
                                          v-model="formParams.assignDeptId"
                                          disabled
                                        >
                                        </el-select>
                                    </el-form-item>
                              </el-col>
                          </CardFormContent>
                   </div>
              </div>

              <div class="righttwo">
                <CardFormTitle title="回复信息"></CardFormTitle>
                <div>
                  <CardFormContent>
                      <el-col :span="12">
                          <el-form-item label="回复人">
                              <el-input
                                  v-model="formParams.replayUserName"
                                  placeholder="暂无"
                                  clearable
                                  disabled
                              />
                          </el-form-item>
                      </el-col>

                      <el-col :span="12">
                           <el-form-item  label="回复时间">
                                <el-input
                                    v-model="formParams.replayTime"
                                    placeholder="暂无"
                                    clearable
                                    disabled
                                />
                            </el-form-item>
                        </el-col>

                      <el-col :span="24">
                            <el-form-item label="回复信息">
                                  <el-input
                                      v-model="formParams.replayOpinion"
                                      placeholder="暂无"
                                      clearable
                                      type="textarea"
                                      maxlength="1000"
                                      show-word-limit
                                      disabled
                                  />
                            </el-form-item>
                        </el-col>
                  </CardFormContent>


                </div>
              </div>
              <div >
                  <CardFormTitle title="处理结果录入"></CardFormTitle>
                  <div>
                    <CardFormContent >
                          <el-form-item  label="处理结果" >
                              <el-select
                                  v-model="assignass"
                                  >
                                   <el-option
                                      v-for="item in enterResult"
                                      :key="item.value"
                                      :label="item.desc"
                                      :value="item.value">
                                   </el-option>
                              </el-select>
                          </el-form-item>
                    </CardFormContent>
                  </div>

              </div>

            </el-col>
          </el-form>
          </el-row>

      </div>


  </div>
</template>

<script>


  // 样式
  import CardFormContent from "@/components/card-form-content"
  // 样式
  import CardFormTitle from "@/components/card-form-title"
   // 详情数据请求
  import { detailsdata,updateEntryHelp } from '@/api/help/input'


export default {
  name: 'HelpInputAdd',

   components:{
    CardFormContent,
    CardFormTitle
  },

    created(){
      this.details();
  },

  data(){
    return {

      // 数据ID
      detectionid:undefined,

      // 详情信息
        formParams:{},

      // 部门数据
        selectdept:{},

      // 下拉值
      enterResult:[
        {
          value:'1',
          desc:"已解决"
          },
        {
          value:'2',
          desc:"未解决"
          }
      ],

      // 下拉选项
      assignass:''

    }
  },

   methods:{
      // 获取详情数据
      details(){
          detailsdata(this.$route.query.id).then((respone)=>{
              this.formParams = { ...respone.data}
          })
      },
      // 提交
      PutIn(){
        let data = this.assign()
        updateEntryHelp(data).then((respone) =>{
          this.$router.push({
            name:"HelpInput"
          })
          window.location.reload()
        })
      },
      // 赋值
      assign(){
        let data = {
          // 主键ID
          id:undefined,
          // 录入人ID
          enterUserId:undefined,
          // 录入人姓名
          enterUserName:undefined,
          // 处理结果
          enterResult:undefined
        }


        data.id = this.$route.query.id

        data.enterUserId = this.$store.getters.userInfo.roleId

        data.enterUserName = this.$store.getters.userInfo.userName

        data.enterResult = this.assignass

        return data;
      }



  },



}
</script>


<style lang="scss" scoped>
  .header{
    width: 100%;
    padding: 10px;
    padding-right: 20px;
    background-color: white;
    text-align: right;
  }


  .content {
    width: 100%;
    height: 700px;
    padding-top: 24px;
    padding-left: 48px;
    padding-right: 48px;

    & .contents{
    border:20px solid rgb(226, 232, 240);
    height: 623px;
    background-color: rgb(255, 255, 255);
    text-align: left;
  }

  }


  .left{
    text-align: left;
  }

  .card-form-title{
    margin-top: 40px;
    padding-left: 10px;

  }

  .card-form-content{
      height:165px;
      width: 60%;
      margin-left: 20px;
  }

  .right-content{
    height: 75px;
  }

  .righttwo{
    height: 240px;
  }






</style>
